/*
 * Scheduler.h
 *
 *  Created on: 2011-8-14
 *      Author: ryan
 */

#ifndef SCHEDULER_H_
#define SCHEDULER_H_

#include "mpi.h"
#include "MapReducer.h"
#include <stdlib.h>
#include <stdio.h>

#define COMTAG 2353
#define TYPE MPI_Datatype
#define BYTE MPI_BYTE
#define INT MPI_INT

#define PRE -1
#define NEXT 1

#define MPI_CHECK(call) \
    if((call) != MPI_SUCCESS) { \
        fprintf(stderr, "MPI error calling \""#call"\"\n"); \
        MPI_Abort(MPI_COMM_WORLD, -1); \
    }

MPI_Request request;
MPI_Status status;

void SEND(void*, int, TYPE, int);
void RECV(void*, int, TYPE, int);
void myAbort(); 

void submit(int, char**);
void stop();

#endif /* SCHEDULER_H_ */
